<?php

/**
 * Home
 * 
 * The default dashboard for the announce application.
 * 
 * @author Oliver Schwarz <oliver.schwarz@vaicon.de>
 * @package Controller
 */
class Home
{

        /**
         * Template engine object
         * @var object
         */
        private $oTpl, $aUser;

        /**
         * Constructor
         */
        public function __construct()
        {
                $this->oTpl = TPL::getInstance();
                $this->aUser = Auth::check();     
        }

        public function protoGetMessages()
        {

                $m = Util::loadController('message');
                return $m->get(); 

        }

        /**
         * Run controller
         */
        public function run()
        {

                $tag = Util::loadController('tag');
                $this->oTpl->assign('tags', $tag->getTagcloud());
                $this->oTpl->assign('user', $this->aUser);
                $this->oTpl->assign('messages', $this->protoGetMessages());
                $this->oTpl->display('home.htpl');
        }

}


?>